import { getData, postData, deleteData, putData } from './axios'

// ? 获取管理员详细信息的Api
export async function findManageApi(id: any) {
  var res = await getData('/manage/find', { id })
  return res
}
// ? 添加单个管理员的Api
export async function addManageApi(data: any) {
  var res = await postData('/manage/add', data)
  return res
}
// ? 修改单个管理员信息的Api
export async function updateManageApi(data: any) {
  var res = await putData('/manage/update', data)
  return res
}
// ? 修改单个管理员的可用状态Api
export async function updateManageStatusApi(id: string, status: boolean) {
  var res = await putData('/manage/changeStatus', { id, manageStatus: status })
  return res
}

// ? 获取管理员列表的Api
export async function getManageListApi(params?: any) {
  var res = await getData('/manage/list', { ...params })
  return res
}
// ? 删除单个管理员的Api
export async function deleteManageApi(id: string) {
  var res = await deleteData('/manage/delete', { id })
  return res
}
